package com.oop.demo06;

public class Student extends Person {

    //默认的无参构造器
    public Student() {
        super("陈陈"); //调用父类的构造器，必须要在子类的构造器之前
        System.out.println("student无参构造器");
    }

    private String name = "偶冉";

    public void print() {
        System.out.println("Student");
    }

    public void test1() {
        print();
        this.print();
        super.print();
    }

    public void test(String name) {
        System.out.println(name); //金鑫
        System.out.println(this.name); //偶冉
        System.out.println(super.name); //陈冲
    }
}
